package com.ithei.多线程第二天.并发工具类.Hashtable;

import java.util.HashMap;

public class Hashmap {
    public static void main(String[] args) throws InterruptedException {
        HashMap<String,String> map=new HashMap<String,String>();
        Thread t1=new Thread(()->{
            for (int i = 0; i < 250; i++) {
                map.put(i+"",i+"");
            }
        });

        Thread t2=new Thread(()->{
            for (int i = 0; i < 250; i++) {
                map.put(i+"",i+"");
            }
        });
        t1.start();
        t2.start();
        Thread.sleep(1000);


        for (int i = 0; i < 250; i++) {
            System.out.println(map.get(i+""));;
        }
    }
}
